package com.example.gustavo.hello;

import android.app.Application;

import com.avos.avoscloud.AVOSCloud;
import com.nostra13.universalimageloader.cache.disc.naming.Md5FileNameGenerator;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.ImageLoaderConfiguration;
import com.nostra13.universalimageloader.core.assist.QueueProcessingType;

/**
 * Created by gustavo on 2015/3/3.
 */
public class MyApplication extends Application{

    public static String downLoadFile;
    public static long id;

    @Override
    public void onCreate() {
        super.onCreate();

        //ImageLoader config init
        ImageLoaderConfiguration configuration =  new ImageLoaderConfiguration.Builder(this)
//                    .diskCache(new LruDiscCache(getCacheFile(), new Md5FileNameGenerator(), 50 * 1024 * 1024))
                .threadPriority(Thread.NORM_PRIORITY - 2)
                .denyCacheImageMultipleSizesInMemory()
                .diskCacheFileNameGenerator(new Md5FileNameGenerator())
                .diskCacheSize(50 * 1024 * 1024) // 50 Mb
                .tasksProcessingOrder(QueueProcessingType.LIFO)
                .writeDebugLogs() // Remove for release app
                .build();
        ImageLoader.getInstance().init(configuration);

    }
}
